package com.example.luke.cashorderingsystem.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.luke.cashorderingsystem.Common.CommonActivity;
import com.example.luke.cashorderingsystem.Model.Operator;
import com.example.luke.cashorderingsystem.R;
import com.example.luke.cashorderingsystem.Util.GlobalFunction;

/**
 * Created by luke on 17/11/2016.
 */

public class HomeActivity extends CommonActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        context=this;

        setBarTitle(GlobalFunction.getResourceString(context,R.string.menu));

    }

    public void optionClick(View view){
        switch (view.getId()){

            case R.id.com_purchase:

            gotoActivity(CommodityActivity.class,0);

                break;

            case R.id.report:

//                if (Operator.getIntance().reportAuthority())

                   gotoActivity(PurchaseReportActivity.class,0);

//                else
//                    GlobalFunction.ToastAlert(this,GlobalFunction.getString(this,R.string.noAuthority));
//
               break;

            case R.id.systemSetting:

                gotoActivity(SystemSettingActivity.class,0);

                break;

        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        restart();


    }
}
